using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._LayersandTableViews
{
    /// <summary>
    /// <para>Select Layer By Attribute</para>
    /// <para>Adds, updates, or removes a selection based on an attribute query.</para>
    /// <para>添加、更新或删除基于属性查询的选定内容。</para>
    /// </summary>    
    [DisplayName("Select Layer By Attribute")]
    public class SelectLayerByAttribute : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SelectLayerByAttribute()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_layer_or_view">
        /// <para>Input Rows</para>
        /// <para>The data to which the selection will be applied.</para>
        /// <para>将应用所选内容的数据。</para>
        /// </param>
        public SelectLayerByAttribute(object _in_layer_or_view)
        {
            this._in_layer_or_view = _in_layer_or_view;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Select Layer By Attribute";

        public override string CallName => "management.SelectLayerByAttribute";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_layer_or_view, _selection_type.GetGPValue(), _where_clause, _out_layer_or_view, _invert_where_clause.GetGPValue(), _count];

        /// <summary>
        /// <para>Input Rows</para>
        /// <para>The data to which the selection will be applied.</para>
        /// <para>将应用所选内容的数据。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Rows")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_layer_or_view { get; set; }


        /// <summary>
        /// <para>Selection type</para>
        /// <para><xdoc>
        ///   <para>Specifies how the selection will be applied and what to do if a selection already exists.</para>
        ///   <bulletList>
        ///     <bullet_item>New selection—The resulting selection replaces the current selection. This is the default.</bullet_item><para/>
        ///     <bullet_item>Add to the current selection—The resulting selection is added to the current selection if one exists. If no selection exists, this is the same as the new selection option.</bullet_item><para/>
        ///     <bullet_item>Remove from the current selection—The resulting selection is removed from the current selection. If no selection exists, this option has no effect.</bullet_item><para/>
        ///     <bullet_item>Select subset from the current selection—The resulting selection is combined with the current selection. Only records that are common to both remain selected.</bullet_item><para/>
        ///     <bullet_item>Switch the current selection—The selection is switched. All records that were selected are removed from the current selection, and all records that were not selected are added to the current selection. The Expression parameter (where_clause in Python) is ignored when this option is specified.</bullet_item><para/>
        ///     <bullet_item>Clear the current selection—The selection is cleared or removed. The Expression parameter (where_clause in Python) is ignored when this option is specified.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何应用所选内容，以及如果已存在所选内容时应执行的操作。</para>
        ///   <bulletList>
        ///     <bullet_item>新选区 - 生成的选区将替换当前选区。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>添加到当前选区 - 生成的选区将添加到当前选区（如果存在）。如果不存在选择，则这与新的选择选项相同。</bullet_item><para/>
        ///     <bullet_item>从当前选区移除 （Remove from the current selection） - 生成的选区将从当前选区中移除。如果不存在任何选择，则此选项无效。</bullet_item><para/>
        ///     <bullet_item>从当前选择中选择子集 - 生成的选择将与当前选择组合在一起。只有两者共有的记录才会保持选中状态。</bullet_item><para/>
        ///     <bullet_item>切换当前选区 - 切换选区。所有已选定的记录都将从当前选定内容中删除，所有未选定的记录都将添加到当前选定内容中。指定此选项时，将忽略 Expression 参数（在 Python 中为 where_clause）。</bullet_item><para/>
        ///     <bullet_item>清除当前选区 - 清除或移除选区。指定此选项时，将忽略 Expression 参数（在 Python 中为 where_clause）。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Selection type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _selection_type_value _selection_type { get; set; } = _selection_type_value._NEW_SELECTION;

        public enum _selection_type_value
        {
            /// <summary>
            /// <para>New selection</para>
            /// <para>New selection—The resulting selection replaces the current selection. This is the default.</para>
            /// <para>新选区 - 生成的选区将替换当前选区。这是默认设置。</para>
            /// </summary>
            [Description("New selection")]
            [GPEnumValue("NEW_SELECTION")]
            _NEW_SELECTION,

            /// <summary>
            /// <para>Add to the current selection</para>
            /// <para>Add to the current selection—The resulting selection is added to the current selection if one exists. If no selection exists, this is the same as the new selection option.</para>
            /// <para>添加到当前选区 - 生成的选区将添加到当前选区（如果存在）。如果不存在选择，则这与新的选择选项相同。</para>
            /// </summary>
            [Description("Add to the current selection")]
            [GPEnumValue("ADD_TO_SELECTION")]
            _ADD_TO_SELECTION,

            /// <summary>
            /// <para>Remove from the current selection</para>
            /// <para>Remove from the current selection—The resulting selection is removed from the current selection. If no selection exists, this option has no effect.</para>
            /// <para>从当前选区移除 （Remove from the current selection） - 生成的选区将从当前选区中移除。如果不存在任何选择，则此选项无效。</para>
            /// </summary>
            [Description("Remove from the current selection")]
            [GPEnumValue("REMOVE_FROM_SELECTION")]
            _REMOVE_FROM_SELECTION,

            /// <summary>
            /// <para>Select subset from the current selection</para>
            /// <para>Select subset from the current selection—The resulting selection is combined with the current selection. Only records that are common to both remain selected.</para>
            /// <para>从当前选择中选择子集 - 生成的选择将与当前选择组合在一起。只有两者共有的记录才会保持选中状态。</para>
            /// </summary>
            [Description("Select subset from the current selection")]
            [GPEnumValue("SUBSET_SELECTION")]
            _SUBSET_SELECTION,

            /// <summary>
            /// <para>Switch the current selection</para>
            /// <para>Switch the current selection—The selection is switched. All records that were selected are removed from the current selection, and all records that were not selected are added to the current selection. The Expression parameter (where_clause in Python) is ignored when this option is specified.</para>
            /// <para>切换当前选区 - 切换选区。所有已选定的记录都将从当前选定内容中删除，所有未选定的记录都将添加到当前选定内容中。指定此选项时，将忽略 Expression 参数（在 Python 中为 where_clause）。</para>
            /// </summary>
            [Description("Switch the current selection")]
            [GPEnumValue("SWITCH_SELECTION")]
            _SWITCH_SELECTION,

            /// <summary>
            /// <para>Clear the current selection</para>
            /// <para>Clear the current selection—The selection is cleared or removed. The Expression parameter (where_clause in Python) is ignored when this option is specified.</para>
            /// <para>清除当前选区 - 清除或移除选区。指定此选项时，将忽略 Expression 参数（在 Python 中为 where_clause）。</para>
            /// </summary>
            [Description("Clear the current selection")]
            [GPEnumValue("CLEAR_SELECTION")]
            _CLEAR_SELECTION,

        }

        /// <summary>
        /// <para>Expression</para>
        /// <para>An SQL expression used to select a subset of records.</para>
        /// <para>用于选择记录子集的 SQL 表达式。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Expression")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _where_clause { get; set; } = null;


        /// <summary>
        /// <para>Updated Layer Or Table View</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Layer Or Table View")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_layer_or_view { get; set; }


        /// <summary>
        /// <para>Invert Where Clause</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the expression will be used as is, or the opposite of the expression will be used.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—The query will be used as is. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—The opposite of the query will be used. If the Selection Type parameter is used, the reversal of the selection occurs before it is combined with existing selections.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是按原样使用表达式，还是使用与表达式相反的表达式。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 查询将按原样使用。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 将使用查询的反面。如果使用“选择类型”参数，则在将选择内容与现有选择组合之前，将发生选择的反转。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Invert Where Clause")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _invert_where_clause_value? _invert_where_clause { get; set; } = null;

        public enum _invert_where_clause_value
        {
            /// <summary>
            /// <para>INVERT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INVERT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NON_INVERT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NON_INVERT")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Count</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Count")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public long? _count { get; set; }


        public SelectLayerByAttribute SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}